package com.common.service;

import com.common.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.remoting.jaxws.SimpleJaxWsServiceExporter;
import org.springframework.stereotype.Service;

import javax.jws.WebMethod;
import javax.jws.soap.SOAPBinding;

/**
 * @classDescription:
 * @author:xiayingjie
 * @createTime:16/8/11
 */
//@javax.jws.WebService(serviceName = "test1")
//@SOAPBinding(style= SOAPBinding.Style.RPC)
//@Service
public class WebService {
    @Autowired
    UserService userService;

    @WebMethod
    public User getUser(int id){
        return this.userService.findById(id);
    }

    @Bean
    public SimpleJaxWsServiceExporter jaxWsServiceExporter(){
        SimpleJaxWsServiceExporter sj=new SimpleJaxWsServiceExporter();
        sj.setBaseAddress("http://0.0.0.0:8888/");
        return sj;
    }
}
